const PluginDemo = {
  // 安装入口
  install(VmClass) {
    // 页面生命周期
    VmClass.mixin({
      onBackPress() {
        let _this = this
        if (!_this.isAllowBackPress) {
          if (_this.backPressRefuseReport) return true
          _this.backPressRefuseReport = true
          COMMON_REPORT_UTILS.back_click_report('', '', '初始化拦截')
          return true
        }
        if (_this.videoBqtConfig.isShow) {
          _this.videoBqtConfig.backPressTimes++
          return true
        }
        if (!_this.nativeBoostGroupController.isShowBoostComp) {
          POP_TOOLS.noAd4UseEventHandler({ actionCode: 'PAGE_BACK', code: '' }, { ..._this.pageDetail }, _this.$app.$def)
          return true
        }
        if (!_this.nativeBoostGroupController.popShow) {
          _this.nativeBoostGroupController.popCode = ''
        }
        _this.nativeBoostGroupController.backPressTimes++
        return true
      }
    })
    // 应用生命周期
    VmClass.mixinApp({
      onShow() {
        console.info(`生命周期-app：onShow`)
        AD_SDK.eventEmitter.emit("MINBING")
      },
      onHide() {
        console.info(`生命周期-app：onHide`)
        AD_SDK.eventEmitter.emit("GEERDAN")
        AD_SDK.activateSuccess()
      },
    })
  }
}

export default PluginDemo
